/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Control;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
/**
 *
 * @author Administrator
 */
public class FlightsConnection {
Connection conn = null;
    String driver_mysql = "com.mysql.jdbc.Driver";
    String url_mysql = "jdbc:mysql://localhost:3306/tan";
    String name = "root";
    String password = "396130";

    public void Load_DB() throws ClassNotFoundException {
        Class.forName(driver_mysql);
        System.out.println("Loading Driver Success");
    }

    public void Connection_DB() throws SQLException {
        conn = DriverManager.getConnection(url_mysql, name, password);
        System.out.println("Connect Database Success");
    }

    public Connection getConn() {
        return conn;
    }

    public void setConn(Connection conn) {
        this.conn = conn;
    }
}


